﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="candidate.aspx.cs" Inherits="manager_user" ValidateRequest="false" %>

<%@ Register assembly="BasicFrame.WebControls.BasicDatePicker" namespace="BasicFrame.WebControls" tagprefix="BDP" %>

<%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Candidate Manager</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="../css/manager.css" />
    </head>
<body>
    <form runat="server">
    <table id="layout_infor" width="100%" border="0" cellpadding="10" runat="server">
        <tr>
            <td valign="top" align="center">
                <div>
                    <asp:Image ID="img_avatar" ImageUrl="../image/manager/no_avatar.jpg" runat="server"
                        Width="150" Height="150" /></div>
            </td>
            <td valign="top">
                <asp:ValidationSummary runat="server" ValidationGroup="vl" />
                <table border="0" cellspacing="5" style="font-size: 18px">
                    <tr>
                        <td width="150" align="right">Email</td>
                        <td>
                            <asp:TextBox ID="txt_email" class="input_text_view" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_email"
                                ErrorMessage="Email is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txt_email"
                                ErrorMessage="Email invalid." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                ValidationGroup="vl">*</asp:RegularExpressionValidator>                                
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Password</td>
                        <td>
                            <asp:TextBox ID="txt_password" class="input_text_view" TextMode="Password" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_password"
                                ErrorMessage="Password is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Confirm Password</td>
                        <td>
                            <asp:TextBox ID="txt_cpassword" class="input_text_view" TextMode="Password" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_cpassword"
                                ErrorMessage="Confirm password is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                            <asp:CompareValidator runat="server" ControlToCompare="txt_password"
                                ControlToValidate="txt_cpassword" ErrorMessage="Confirm password invalid." ValidationGroup="vl">*</asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Name</td>
                        <td>
                            <asp:TextBox ID="txt_name" class="input_text_view" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_name"
                                ErrorMessage="Name is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>                           
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Address</td>
                        <td>
                            <asp:TextBox ID="txt_address" class="input_text_view" runat="server" ></asp:TextBox>
                             <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_address"
                                ErrorMessage="Address is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">City</td>
                        <td>
                            <asp:TextBox ID="txt_city" class="input_text_view" runat="server" ></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_city"
                                ErrorMessage="City is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>   
                        </td>
                    </tr>

                     <tr>
                        <td align="right">Country</td>
                        <td>
                            <asp:TextBox ID="txt_country" class="input_text_view" runat="server" ></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_country"
                                ErrorMessage="Country is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Phone</td>
                        <td>
                            <asp:TextBox ID="txt_phone" class="input_text_view" runat="server" MaxLength="20"></asp:TextBox>
                                <asp:RegularExpressionValidator runat="server" ControlToValidate="txt_phone"
                                ErrorMessage="Phone enter only numbers" ValidationExpression="^\d+$" ValidationGroup="vl">*</asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">Description</td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="ftb_description"
                                ErrorMessage="Description is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                            <FTB:FreeTextBox ID="ftb_description" Height="200px" Width="100%" 
                                runat="server" ButtonSet="OfficeMac">
                            </FTB:FreeTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Birthday</td>
                        <td>
                            <BDP:BasicDatePicker ID="bdp_birthday" runat="server" DateFormat="yyyy-MM-dd" ReadOnly="True"></BDP:BasicDatePicker>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="bdp_birthday"
                                ErrorMessage="Please choose birthday." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Avatar</td>
                        <td><asp:FileUpload ID="file_upload" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Button ID="btn_save" ValidationGroup="vl" class="btnWhite" runat="server" Text="Save" onclick="btn_save_Click" />
                            <asp:Button ID="btn_reset" class="btnWhite" runat="server" Text="Reset" onclick="btn_reset_Click" />
                            <asp:Button ID="btn_edit" class="btnWhite" runat="server" Text="Edit" Visible="false" onclick="btn_edit_Click" />
                            <asp:Button ID="btn_back" class="btnWhite" runat="server" Text="Back" onclick="btn_back_Click" />
                            <div style="font-size: 15px; color: #F00; padding-top: 10px">
                                <b><asp:Label ID="lbl_msg" runat="server" Text=""></asp:Label></b>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div id="layout_gridview" style="padding: 10px; margin: 0 0 60px 0" runat="server">
        <div style="height: 50px">
            <div style="float: left">
                <asp:Button ID="btn_add" class="btnGreen" runat="server" Text="Add" onclick="btn_add_Click" />
                <asp:Button ID="btn_del" class="btnRed" runat="server" Text="Delete" onclick="btn_del_Click" />
                <asp:Button ID="btn_refresh" class="btnWhite" runat="server" Text="Refresh" onclick="btn_refresh_Click" />
            </div>
            <div style="float: right">
                <asp:TextBox ID="txt_search" class="input_text_view" runat="server"></asp:TextBox>
                <asp:Button ID="btn_search" class="btnWhite" runat="server" Text="Search" onclick="btn_search_Click" />
            </div>
        </div>
        <div style="font-size: 15px; color: #F00; padding-top: 10px; text-align: center">
            <b><asp:Label ID="lbl_not_data" runat="server" Text=""></asp:Label></b>
        </div>
        <asp:GridView ID="mGridView" Style="border: 1px solid #a9a9a9" runat="server" Width="100%"
            AutoGenerateColumns="False" BackColor="White" BorderColor="Black" BorderStyle="None"
            BorderWidth="1px" CellPadding="5" AllowPaging="True" AllowSorting="True" 
            PageSize="15" onpageindexchanging="mGridView_PageIndexChanging" onselectedindexchanged="mGridView_SelectedIndexChanged">
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <Columns>
                <asp:TemplateField HeaderText="Select">
                    <ItemTemplate>
                        <input type="checkbox" id="chk" runat="server" value='<%#Eval("email") %>' />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="40px" />
                </asp:TemplateField>
                <asp:BoundField DataField="email" HeaderText="Email">
                    <ItemStyle Width="170px" />
                </asp:BoundField>
                <asp:BoundField DataField="name" HeaderText="Name">
                    <ItemStyle Width="150px" />
                </asp:BoundField>
                <asp:BoundField DataField="address" HeaderText="Address" />
                <asp:BoundField DataField="city" HeaderText="City"> 
                    <ItemStyle Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="birthday" HeaderText="Birthday" >
                    <ItemStyle HorizontalAlign="Center" Width="80px" />
                </asp:BoundField>
                <asp:CommandField HeaderText="Edit" SelectText="Edit" ShowSelectButton="True">
                    <ItemStyle HorizontalAlign="Center" Width="30px" />
                </asp:CommandField>
            </Columns>
            <RowStyle ForeColor="#000066" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <HeaderStyle BackColor="#05ADEE" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>
